﻿using Prism.Commands;
using Prism.Common;
using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Data;

namespace Prism.ViewModel
{
    public class MainViewModel : BindableBase
    {
        public DelegateCommand DelegateCommand { get; }
        public DelegateCommand<string> ParamCommand { get; }
        public CompositeCommand CompositeCommand { get; }
        public DelegateCommand<string> MvvmlightCommand { get; }

        public MainViewModel()
        {
            DelegateCommand = new DelegateCommand(() =>
            {
                MessageBox.Show("无参的DelegateCommand");
            });

            ParamCommand = new DelegateCommand<string>((message) =>
            {
                MessageBox.Show(message);
            });
            CompositeCommand = new CompositeCommand();
            CompositeCommand.RegisterCommand(DelegateCommand);
            CompositeCommand.RegisterCommand(ParamCommand);

            MvvmlightCommand = new DelegateCommand<string>((message) =>
            {
                MessageBox.Show(message);
            });
        }
    }

}
